﻿using System;
using EmailJabber.EmailJabber.Core.Entities;
using EmailJabber.Logic.Commands.Base;
using EmailJabber.Logic.Logic.BusinessLogic;

namespace EmailJabber.Logic.Commands
{
    public class AddToBaseCommand :CommandBase
    {
        protected override string GetDecription()
        {
            return "Add note to base";
        }

        protected override Guid GetId()
        {
            return new Guid("D997CAFA-355E-4AE6-BD25-49BAF003CA35");
        }

        protected override void ExecuteSafe(MessageIM message)
        {
            LogEntry  entry =new LogEntry(message.Body,DateTime.Now);
            BL.Instance.AddLogEntry(entry);
            MessageIM result =new MessageIM(message.To,"Done.",message.From);
            BL.Instance.Send(result);
        }
    }
}